<style type="text/css" media="print">
.printbutton {
  visibility: hidden;
  display: none;
}
</style>

<?php require_once("includes/initializeSession.php"); ?>
<?php

if (isset($_GET['manuyRow']) && isset($_SESSION['person_number'])   )
{
	require("includes/openConnection.php");

	$sql  = "SELECT M.manuy_number,M.total_payment ,A.lastname as agent_last,A.firstname as agent_first,A.person_number as agent_number,M.from_2,M.until,P.lastname,P.firstname,P.city,P.address,P.person_id,manufacturer,M.model,M.license_plate,M.production_year,M.product_desc FROM manuy2client AS M,person AS P,person AS A 
            WHERE M.manuy_row='{$_GET['manuyRow']}' AND M.person_number = P.person_number AND M.agent_person_number = A.person_number AND A.person_number ='{$_SESSION['person_number']}' ";
	//echo $sql;
	$result = mysql_query ($sql);
	if (mysql_num_rows($result)) 
	{
	$r = mysql_fetch_assoc($result)	
                
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>  
<title>ר.א צ'ק אין - פתרונות ביטוח</title>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<script>
function printpage()
  {
  window.print()
  }
</script>


</head>
<body background="images/admin_bg.jpg" style="background-repeat:no-repeat" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"><a href="../report.asp" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#6699FF"></a></div>
<div align="right" style="padding-right:25px; ">
<img src="images/logo.jpg">
</div>
<br />
<div dir="rtl" align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:17px; color:#333333; padding-right:15px;  ">
ר.א.צ'ק אין בע"מ מברכת אותך לרגל הצטרפותך כמנוי של החברה .<br />
השירותים להם הנך זכאי הנם ע"פ סוג המנוי אותו רכשת ובכפוף לכתב השירות  הרלוונטי.
<br />
<br />

</div>
<div align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#6699FF; font-weight:bold;  padding-right:10px;">תאריך וזמן הנפקת המסמך:
<?php
 echo  date("d/m/Y H:i:s");
 //   echo  date("Y-m-d H:i:s");
?>
    <br />
<br />

</div>
<table  width="650" cellspacing="10" cellpadding="5" border="0" align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; " dir="rtl">

<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">מספר מנוי: </td>
<td width="280" style="border:4px double grey; "><?php echo $r['manuy_number'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">סה"כ לתשלום: </td>
<td width="150" style="border:4px double grey;  "><?php echo $r['total_payment'] ?></td>
</tr>
<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">שם הסוכן: </td>
<td width="150" style="border:4px double grey;  "><?php echo $r['agent_last']. " ". $r['agent_first'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">מספר הסוכן: </td>
<td width="150" style="border:4px double grey;  "><?php echo $r['agent_number'] ?></td>
</tr>

<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">מתאריך: </td>
<td width="150" style="border:4px double grey;  "><?php echo $r['from_2'] ?></td>
<td></td>

<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">עד תאריך: </td>
<td width="150" style="border:4px double grey;  "><?php echo $r['until'] ?></td>
</tr>
<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE ">שם משפחה: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['lastname'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">שם פרטי: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['firstname'] ?></td>
</tr>
<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">כתובת: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['city']. " ". $r['address'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">ת"ז: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['person_id'] ?></td>
</tr>
<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">סוג הרכב: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['manufacturer']. " ". $r['model'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">מספר רישוי: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['license_plate'] ?></td>
</tr>
<tr>
<td width="150" style="border:4px double grey; background-color:#EEEEEE">שנת ייצור: </td>
<td width="150" style="border:4px double grey; "><?php echo $r['production_year'] ?></td>
<td></td>
<td></td>
<td width="150" style="border:4px double grey;  background-color:#EEEEEE">הכיסוי שרכשת: </td>
<td width="300" style="border:4px double grey; font-size:14px; "><strong><?php echo $r['product_desc'] ?></strong></td>
</tr>


<tr><td>
<br />
<br>
    <input type="button" 
  onClick="window.print()" 
  class="printbutton"
  value="הדפס מסמך"/>

<br />
<br />

</td></tr>

</table>

<?php
		}
	require("includes/closeConnection.php");
}
	?>